package com.misweb.ibase;



import com.misweb.ibase.model.GlobalErrorEvent;

import org.androidannotations.annotations.EBean;

import org.androidannotations.rest.spring.api.RestErrorHandler;
import org.springframework.core.NestedRuntimeException;

import de.greenrobot.event.EventBus;

/**
 * Created by shicheng on 2015/4/8.
 */
@EBean
public class NetWorkErrorHandler implements RestErrorHandler {
    EventBus eventBUS=GlobalApplication.eventBUS;
    @Override
    public void onRestClientExceptionThrown(NestedRuntimeException e) {
        eventBUS.post(new GlobalErrorEvent("network","网络连接异常"+e.getMessage()));
    }
}